home *** CD-ROM | disk | FTP | other *** search
/ C++ für Kids / C++ for kids.iso / Buch / Noten1.cpp < prev    next >
C/C++ Source or Header  |  1998-12-11  |  982b  |  26 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl\vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "Noten1.h"
  6. //---------------------------------------------------------------------------
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. int Zensur;
  10. //---------------------------------------------------------------------------
  11. __fastcall TForm1::TForm1(TComponent* Owner)
  12.     : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16. void __fastcall TForm1::Button1Click(TObject *Sender)
  17. {
  18.   Zensur = StrToInt (Edit1->Text);
  19.   if (Zensur == 1) Label1->Caption = "sehr gut";
  20.   if (Zensur == 2) Label1->Caption = "gut";
  21.   if (Zensur == 3) Label1->Caption = "befriedigend";
  22.   if (Zensur == 4) Label1->Caption = "ausreichend";
  23.   if (Zensur == 5) Label1->Caption = "mangelhaft";
  24.   if (Zensur == 6) Label1->Caption = "ungenⁿgend";
  25. }
  26. //---------------------------------------------------------------------------